package com.event.core.listener;

import com.event.common.model.UpdateAfterEvent;
import com.event.common.model.UpdateBeforeEvent;
import com.event.common.face.IEventHandle;
import com.google.common.eventbus.Subscribe;

/*
 * @description 事件监听器
 * @author Bing
 * @date 2024/10/8 14:07
 **/
public class EventListener {

    private IEventHandle eventHandle;

    public EventListener(IEventHandle eventHandle)
    {
        this.eventHandle = eventHandle;
    }

    @Subscribe
    public void handle(UpdateBeforeEvent event)
    {
        eventHandle.handle(event);
    }

    @Subscribe
    public void handle(UpdateAfterEvent event)
    {
        eventHandle.handle(event);
    }
}
